package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
public class Payment {
    private int paymentId;
    private BigDecimal paymentMoney;
    private BigDecimal medicalBalance13;
    private String paymentMode;
    private String paymentProjects;
    private Medical medicalByMedicalId;
    private Veg vegByVegId;
    private Patient patientByPatientId;

    @Id
    @Column(name = "payment_id", nullable = false)
    public int getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(int paymentId) {
        this.paymentId = paymentId;
    }

    @Basic
    @Column(name = "payment_money", nullable = true, precision = 2)
    public BigDecimal getPaymentMoney() {
        return paymentMoney;
    }

    public void setPaymentMoney(BigDecimal paymentMoney) {
        this.paymentMoney = paymentMoney;
    }

    @Basic
    @Column(name = "medical_balance13", nullable = true, precision = 2)
    public BigDecimal getMedicalBalance13() {
        return medicalBalance13;
    }

    public void setMedicalBalance13(BigDecimal medicalBalance13) {
        this.medicalBalance13 = medicalBalance13;
    }

    @Basic
    @Column(name = "payment_mode", nullable = true, length = 20)
    public String getPaymentMode() {
        return paymentMode;
    }

    public void setPaymentMode(String paymentMode) {
        this.paymentMode = paymentMode;
    }

    @Basic
    @Column(name = "payment_projects", nullable = true, length = 20)
    public String getPaymentProjects() {
        return paymentProjects;
    }

    public void setPaymentProjects(String paymentProjects) {
        this.paymentProjects = paymentProjects;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Payment payment = (Payment) o;
        return paymentId == payment.paymentId &&
                Objects.equals(paymentMoney, payment.paymentMoney) &&
                Objects.equals(medicalBalance13, payment.medicalBalance13) &&
                Objects.equals(paymentMode, payment.paymentMode) &&
                Objects.equals(paymentProjects, payment.paymentProjects);
    }

    @Override
    public int hashCode() {
        return Objects.hash(paymentId, paymentMoney, medicalBalance13, paymentMode, paymentProjects);
    }

    @ManyToOne
    @JoinColumn(name = "medical_id", referencedColumnName = "medical_id")
    public Medical getMedicalByMedicalId() {
        return medicalByMedicalId;
    }

    public void setMedicalByMedicalId(Medical medicalByMedicalId) {
        this.medicalByMedicalId = medicalByMedicalId;
    }

    @ManyToOne
    @JoinColumn(name = "veg_id", referencedColumnName = "veg_id")
    public Veg getVegByVegId() {
        return vegByVegId;
    }

    public void setVegByVegId(Veg vegByVegId) {
        this.vegByVegId = vegByVegId;
    }

    @ManyToOne
    @JoinColumn(name = "patient_id", referencedColumnName = "patient_id")
    public Patient getPatientByPatientId() {
        return patientByPatientId;
    }

    public void setPatientByPatientId(Patient patientByPatientId) {
        this.patientByPatientId = patientByPatientId;
    }
}
